import React from 'react'
import ReactDOM from 'react-dom'
import Widget from './components/widget'
import Regulable from './components/regulable'

class App extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      style: {
        left: 0,
        top: 0
      }
    }
  }

  handleChangeStyle = (style) => {
    this.setState({style})
  }

  render() {
    return (
      <Widget style={this.state.style}>
        <Regulable onChangeStyle={this.handleChangeStyle} />
      </Widget>
    )
  }
}

ReactDOM.render(
  <App />,
  document.getElementById('root')
)
